package servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Author：毕龙
 * Date: 2023/7/27 15:22
 */
@WebServlet("/sr2")
public class ServletResponse2 extends HttpServlet {
    @Override
    public  void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取相应的字节流
        response.setHeader("content-type", "text/html;charset=utf-8");

        PrintWriter pw = response.getWriter();
        pw.write("<h1>坚持到底就是胜利！！！</h1>");
        pw.write("<p>我的职业是父亲,培养孩子一个毅力</p>");
    }
}
